﻿'------------------------------------------------For FigureElement------------------------------------------------'
'选择器
Public Class Selector

End Class

'拖拽器
Public Class Dragger

End Class

'缩放点
Public Class ZoomPoint
    Inherits FigureElement

    'Sub New(point As Point)
    '    MyBase.New(point.X, point.Y, nZoomPointLen, nZoomPointLen)
    'End Sub
    Public Overrides Sub BufferRender()
        MyBase.BufferRender()

        m_BufferDC.FillRectangle(m_Brush, m_BaseRect)
        m_BufferDC.DrawRectangle(m_Pen, m_BaseRect)

    End Sub


End Class

'缩放器
Public Class Zoomer
    Sub New(ByRef rc As Rectangle)
        m_bEnable = False
        SetBase(rc)
    End Sub

    Public Sub SetBase(ByRef rect As Rectangle)
        For i = 0 To 7
            If m_zoompoint(i).GetRect = Nothing Then
                m_zoompoint(i) = New ZoomPoint
            End If
        Next

        '上
        m_zoompoint(0).SetRect(rect.Left + rect.Width / 2 - nZoomPointLen / 2, rect.Top - nZoomPointLen / 2, nZoomPointLen, nZoomPointLen)

        '下
        m_zoompoint(1).SetRect(rect.Left + rect.Width / 2 - nZoomPointLen / 2, rect.Bottom - nZoomPointLen / 2, nZoomPointLen, nZoomPointLen)

        '左
        m_zoompoint(2).SetRect(rect.Left - nZoomPointLen / 2, rect.Top + rect.Height / 2 - nZoomPointLen / 2, nZoomPointLen, nZoomPointLen)

        '右
        m_zoompoint(3).SetRect(rect.Right - nZoomPointLen / 2, rect.Top + rect.Height / 2 - nZoomPointLen / 2, nZoomPointLen, nZoomPointLen)

        '左上
        m_zoompoint(4).SetRect(rect.Left - nZoomPointLen / 2, rect.Top - nZoomPointLen / 2, nZoomPointLen, nZoomPointLen)

        '左下
        m_zoompoint(5).SetRect(rect.Left - nZoomPointLen / 2, rect.Bottom - nZoomPointLen / 2, nZoomPointLen, nZoomPointLen)

        '右上
        m_zoompoint(6).SetRect(rect.Right - nZoomPointLen / 2, rect.Top - nZoomPointLen / 2, nZoomPointLen, nZoomPointLen)

        '右下
        m_zoompoint(7).SetRect(rect.Right - nZoomPointLen / 2, rect.Bottom - nZoomPointLen / 2, nZoomPointLen, nZoomPointLen)
    End Sub

    Private m_zoompoint(7) As ZoomPoint

    Private m_bEnable As Boolean
    Public Shared nZoomPointLen As Integer = 6
End Class

'------------------------------------------------For Canvas------------------------------------------------'
'选择工具
Public Class SelectTool

End Class

'拖拽工具
Public Class DragTool

End Class

'缩放工具
Public Class ZoomTool

End Class

'绘图工具
Public Class DrawingTool

End Class